//
// Created by ✎﹏ℳ๓独赏 ☆独醉 on 2023/4/16.
//
//1 1 2 3 5 8 13 21 34......
#include <stdio.h>
long long arr[100];
int fib(int n){
    if(n==1 || n==2){return arr[n] = 1;}
    else{return arr[n] = fib(n-1) + fib(n-2);}
}
int fib02(int n){
    int a=1,b=1,c=1;
    while(n>2){c=a+b,a=b,b=c,n--;}
    return c;
}
int main(){
    int temp,i;
    scanf("%d",&temp);
    fib(temp);
    for(i = 1; i<= temp;i++){printf("%ld ",arr[i]);}
    printf("\n%d",fib02(temp));
    return 0;
}